local zhiba_other = fk.CreateSkill {

  name = "joyex__zhiba_other&",

  tags = {  },

}



zhiba_other:addEffect("active", {
  name = "joyex__zhiba_other&",
  anim_type = "support",
  prompt = "#joyex__zhiba-active",
  mute = true,
  can_use = function(self, player)
    if player:usedSkillTimes(zhiba_other.name, Player.HistoryPhase) < 1 and player.kingdom == "wu" then
      return table.find(Fk:currentRoom().alive_players, function(p) return p:hasSkill("joyex__zhiba") and p ~= player end)
    end
    return false
  end,
  card_num = 1,
  card_filter = function(self, player, to_select, selected)
    return #selected < 1 and (Fk:getCardById(to_select).trueName == "slash" or Fk:getCardById(to_select).name == "duel")
  end,
  target_num = 0,
  on_use = function(self, room, effect)
    local player = effect.from
    local targets = table.filter(room.alive_players, function(p) return p:hasSkill("joyex__zhiba") and p ~= player end)
    local target
    if #targets == 1 then
      target = targets[1]
    else
      target = room:getPlayerById(room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, nil, zhiba_other.name, false)[1])
    end
    if not target then return false end
    room:notifySkillInvoked(player, "joyex__zhiba")
    player:broadcastSkillInvoke("joyex__zhiba")
    room:doIndicate(effect.from, { target.id })
    room:moveCardTo(effect.cards, Player.Hand, target, fk.ReasonGive, zhiba_other.name, nil, true)
  end,
})

return zhiba_other